# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=mygui
pkgver=3.4.1
pkgrel=7
pkgdesc="A multilayer and overlappable GUI System"
# Note: only tested on the following archs, may work on others too but not
# adding them until this has been confirmed
arch="x86_64 aarch64"
url="http://mygui.info/"
license="MIT"
makedepends="boost-dev cmake oxygen graphviz font-dejavu doxygen freetype-dev ois-dev glu-dev samurai"
subpackages="$pkgname-dev"
source="https://github.com/MyGUI/mygui/archive/MyGUI$pkgver.tar.gz
	gcc13.patch
	"
# Package includes unit tests but they require glx/acceleration
options="!check"
builddir="$srcdir/mygui-MyGUI$pkgver"

build() {
	sed -i "71 i set(MYGUI_GCC_VISIBILITY_FLAGS "")" CMakeLists.txt
	sed -i "s/\$OIS_LIBRARIES/$OIS_LIBRARIES boost_system/g" Common/CMakeLists.txt

	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DMYGUI_INSTALL_TOOLS=TRUE \
		-DMYGUI_INSTALL_DOCS=TRUE \
		-DMYGUI_INSTALL_MEDIA=TRUE \
		-DMYGUI_BUILD_DEMOS=FALSE \
		-DMYGUI_BUILD_TOOLS=FALSE \
		-DCMAKE_BUILD_TYPE=None \
		-DMYGUI_RENDERSYSTEM=7 \
		-DBUILD_SHARED_LIBS=TRUE

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
9d36272345b1a755db88848c8a0919feb6f8ae09d048efa3b8ed833bb5ddb9c65e1e7e0d26ad39eecd2a4de53fb654f4099c555e9ebd21ce9541a1a74580ef05  MyGUI3.4.1.tar.gz
b2566ceb73a2ca23d3ef5320d905c4190b8ded30fa6f1b69f8eee6df4ab86a3cd8fc0a3f5c1db5895b4364484b799646f58e4a0959fee9be35695ff037b064b6  gcc13.patch
"
